<template>
  <div class="list">
    <dv-full-screen-container>
    <div class="chan-ye-da-shu-ju">
      <div class="top">
        <div class="left">
          <div class="date">{{ date }}</div>
        </div>
        <div class="center">
          <div class="title">{{ title }}</div>
        </div>
        <div class="right">
          <div class="update-date">{{ updateDate }}</div>
          <div class="exit">
            <ali-icon
              icon="iconquanping"
              class="card-mark"
            />
            <el-button
              type="text"
              @click="big"
            >
              退出
            </el-button>
          </div>
        </div>
      </div>
      <div class="content">
        <div class="left">
          <div class="content-left-box">
            <dv-border-box-7 :color="['#558FB5', '#6DB7E8']" style="box-shadow:none">
              <div class="title">产业总量趋势</div>
              <!-- <g2-example /> -->
              <!-- <total-advantage :data="data.industryTrend" type="industryTrend" /> -->
              <mian-ji-big :data="data.industryTrend" />
            </dv-border-box-7>
          </div>
          <div class="content-left-box">
            <dv-border-box-7 :color="['#558FB5', '#6DB7E8']" style="box-shadow:none">
              <div class="title">产业细分领域分部</div>
              <!-- <subdivision /> -->
              <subdivision-data-v :data="data.industrySubdivide" />
            </dv-border-box-7>
          </div>
        </div>
        <div class="center">
          <div class="content-center-box">
            <dv-flyline-chart-enhanced :config="config" :dev="true" style="width:100%;height:100%;" />
          </div>
        </div>
        <div class="right">
          <div class="content-right-box">
            <dv-border-box-7 :color="['#558FB5', '#6DB7E8']" style="box-shadow:none">
              <div class="title">产业优企分布</div>
              <advantage :data="data.industryDistribution" type="industryDistribution" :header="['企业名称', '注册资本', '区域']" />
            </dv-border-box-7>
          </div>
          <div class="content-right-box">
            <dv-border-box-7 :color="['#558FB5', '#6DB7E8']" style="box-shadow:none">
              <div class="title">新闻动态</div>
              <advantage :data="data.industryNews" type="industryNews" :header="['标题', '来源']" />
            </dv-border-box-7>
          </div>
        </div>
      </div>
      <div class="bottom">
        <div class="left">
          <dv-border-box-7 :color="['#558FB5', '#6DB7E8']" style="box-shadow:none">
            <div class="title" style="float:left">产业三年度数据</div>
            <!-- <total-advantage :data="data.industryThree" type="industryThree" /> -->
            <bar-big :data="data.industryThree" />
          </dv-border-box-7>
        </div>
        <div class="right">
          <dv-border-box-7 :color="['#558FB5', '#6DB7E8']" style="box-shadow:none">
            <div class="title">产业规模分布</div>
            <!-- <scale :industry-data="data.parkIndustry" :type-data="data.parkCompanyType" /> -->
            <bing-zhuang-big :industry-data="data.parkIndustry" :type-data="data.parkCompanyType" />
          </dv-border-box-7>
        </div>
      </div>
    </div>
    </dv-full-screen-container>
  </div>
</template>

<script>
import ChinaMap from "@/assets/img/china-map.png"
import TianChong from "@/assets/img/tianchong.png"
// import G2Example from "./components/g2Example"
import Advantage from "./components/Advantage"
// import Subdivision from "./components/Subdivision"
import SubdivisionDataV from "./components/SubdivisionDataV"
import TotalAdvantage from "./components/TotalAdvantage"
import Scale from "./components/Scale"
import { all } from "@/api/data/industry"
import BingZhuangBig from "./components/BingZhuangBig"
import BarBig from "./components/BarBig"
import MianJiBig from "./components/MianJiBig"
import { currentTime, currentHis } from "@/utils/tools"

export default {
  components: {
    // G2Example,
    Advantage,
    // Subdivision,
    SubdivisionDataV,
    TotalAdvantage,
    Scale,
    BingZhuangBig,
    BarBig,
    MianJiBig
  },
  mounted() {
    this.timer = setInterval(() => {
      this.date = currentTime()
      this.updateDate = `数据更新时间：${currentHis()}`
    }, 1000)
  },
  data() {
    return {
      data: [],
      date: '2020年9月27日 星期一 14:42:47',
      title: '产业大数据分析',
      updateDate: '数据更新时间：14:43:13',
      config: {
        points: [
          {
            name: '广东',
            coordinate: [0.73, 0.85],
            halo: {
              show: true,
              color: '#81D5F7',
              radius: 40
            },
            icon: {
              src: TianChong,
              width: 10,
              height: 10
            },
            text: {
              show: false
            }
          },
          {
            name: '青海',
            coordinate: [0.36, 0.49],
            halo: {
              show: true,
              color: '#81D5F7',
              radius: 40
            },
            icon: {
              src: TianChong,
              width: 10,
              height: 10
            },
            text: {
              show: false
            }
          },
          {
            name: '山西',
            coordinate: [0.69, 0.46],
            halo: {
              show: true,
              color: '#81D5F7',
              radius: 40
            },
            icon: {
              src: TianChong,
              width: 10,
              height: 10
            },
            text: {
              show: false
            }
          },
          {
            name: '四川',
            coordinate: [0.49, 0.65],
            halo: {
              show: true,
              color: '#81D5F7',
              radius: 40
            },
            icon: {
              src: TianChong,
              width: 10,
              height: 10
            },
            text: {
              show: false
            }
          },
          {
            name: '新疆',
            coordinate: [0.18, 0.37]
          },
          {
            name: '西藏',
            coordinate: [0.24, 0.62]
          },
          {
            name: '青海',
            coordinate: [0.36, 0.49]
          },
          {
            name: '云南',
            coordinate: [0.47, 0.83]
          },
          {
            name: '四川',
            coordinate: [0.49, 0.65]
          },
          {
            name: '甘肃',
            coordinate: [0.53, 0.52]
          },
          {
            name: '宁夏',
            coordinate: [0.57, 0.47]
          },
          {
            name: '内蒙古',
            coordinate: [0.62, 0.37]
          },
          {
            name: '南海',
            coordinate: [0.65, 0.97]
          },
          {
            name: '台湾',
            coordinate: [0.88, 0.82]
          },
          {
            name: '广西',
            coordinate: [0.62, 0.84]
          },
          {
            name: '广东',
            coordinate: [0.73, 0.85]
          },
          {
            name: '贵州',
            coordinate: [0.58, 0.76]
          },
          {
            name: '湖南',
            coordinate: [0.68, 0.73]
          },
          {
            name: '江西',
            coordinate: [0.76, 0.74]
          },
          {
            name: '福建',
            coordinate: [0.81, 0.76]
          },
          {
            name: '重庆',
            coordinate: [0.60, 0.67]
          },
          {
            name: '湖北',
            coordinate: [0.68, 0.63]
          },
          {
            name: '安徽',
            coordinate: [0.78, 0.60]
          },
          {
            name: '浙江',
            coordinate: [0.85, 0.67]
          },
          {
            name: '上海',
            coordinate: [0.87, 0.61]
          },
          {
            name: '江苏',
            coordinate: [0.84, 0.57]
          },
          {
            name: '河南',
            coordinate: [0.70, 0.55]
          },
          {
            name: '陕西',
            coordinate: [0.61, 0.54]
          },
          {
            name: '山西',
            coordinate: [0.69, 0.46]
          },
          {
            name: '河北',
            coordinate: [0.73, 0.43]
          },
          {
            name: '北京',
            coordinate: [0.75, 0.37]
          },
          {
            name: '山东',
            coordinate: [0.78, 0.48]
          },
          {
            name: '辽宁',
            coordinate: [0.86, 0.32]
          },
          {
            name: '吉林',
            coordinate: [0.90, 0.25]
          },
          {
            name: '黑龙江',
            coordinate: [0.90, 0.15]
          }
        ],
        lines: [
          {
            source: '青海',
            target: '广东'
          },
          {
            source: '广东',
            target: '青海'
          },
          {
            source: '山西',
            target: '广东'
          },
          {
            source: '广东',
            target: '山西'
          },
          {
            source: '四川',
            target: '广东'
          },
          {
            source: '广东',
            target: '四川'
          },
          {
            source: '云南',
            target: '广东'
          },
          {
            source: '山东',
            target: '广东'
          },
          {
            source: '浙江',
            target: '广东'
          },
          {
            source: '新疆',
            target: '广东'
          },
          {
            source: '黑龙江',
            target: '广东'
          },
          {
            source: '内蒙古',
            target: '广东'
          },
          {
            source: '陕西',
            target: '广东'
          },
          {
            source: '北京',
            target: '广东'
          },
          {
            source: '西藏',
            target: '广东'
          },
          {
            source: '南海',
            target: '广东'
          },
          {
            source: '台湾',
            target: '广东'
          }
        ],
        // icon: {
        //   show: true,
        //   src: TianChong
        // },
        text: {
          show: true,
          offset: [0, 6],
          fontSize: 7,
          color: '#81D5F7'
        },
        k: 0.5,
        bgImgSrc: ChinaMap,
        // halo: {
        //   show: true,
        //   color: '#83B1F1'
        // }
      }
    }
  },
  created() {
    this.search()
  },
  methods: {
    big() {
      this.fullscreen()
      this.$router.push({
        name: 'data/industry/index',
        path: 'data/industry/index'
      })
      this.$router.go(0)
    },
    fullscreen() {
      var el = document.documentElement;
      var rfs =
        el.requestFullScreen ||
        el.webkitRequestFullScreen ||
        el.mozRequestFullScreen ||
        el.msRequestFullScreen;

      //typeof rfs != "undefined" && rfs
      if (rfs) {
        rfs.call(el);
      } else if (typeof window.ActiveXObject !== "undefined") {
        //for IE，这里其实就是模拟了按下键盘的F11，使浏览器全屏
        var wscript = new ActiveXObject("WScript.Shell");
        if (wscript != null) {
          wscript.SendKeys("{F11}");
        }
      }
    }
    // 查询数据
    , search() {
      all((response) => {
        this.data = response.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>
@import "@/styles/data/industry/screen";
</style>
